home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 4 / The Arsenal Files 4 (Arsenal Computer).ISO / clarion / disabl.exe / CONTACTS.CLW < prev    next >
Text File  |  1995-01-05  |  19KB  |  533 lines

  1.  PROGRAM
  2.    MAP
  3.      CheckOpen(FILE,<BYTE>,<BYTE>)
  4.      ReportPreview
  5.      StandardWarning(LONG,<STRING>,<STRING>,<STRING>,<STRING>),LONG
  6.      RIUpdate:Status(STRING),LONG
  7.      RIDelete:Status,LONG
  8.      RIUpdate:contacts(STRING),LONG
  9.      RIDelete:contacts,LONG
  10.      MODULE('CONTA001.clw')
  11.        Main 
  12.      END
  13.      MODULE('CONTA002.clw')
  14.        UpdateProc 
  15.      END
  16.      MODULE('CONTA003.clw')
  17.        ReportByLastName 
  18.        BrowseByLastName 
  19.      END
  20.      MODULE('CONTA004.clw')
  21.        BrowseByCompany 
  22.        ReportByCompany 
  23.      END
  24.      MODULE('CONTA005.clw')
  25.      END
  26.      MODULE('CONTA006.clw')
  27.        BrowseByDate 
  28.      END
  29.      MODULE('CONTA007.clw')
  30.      END
  31.      MODULE('CONTA008.clw')
  32.      END
  33.      MODULE('CONTA009.clw')
  34.        ReadMe 
  35.      END
  36.    END
  37.  
  38.    INCLUDE('Equates.CLW')
  39.    INCLUDE('Keycodes.CLW')
  40.    INCLUDE('Errors.CLW')
  41.  
  42. AppRef1   &WINDOW
  43. savethread1   LONG
  44. BrowseByCompanyOpen   LONG(0)
  45. BrowseByCompanyRef1   &WINDOW
  46. ButtonRef1   LONG
  47. ASCIIFileName   CSTRING(80)
  48.  
  49. GlobalRequest     LONG(0),THREAD
  50. GlobalResponse    LONG(0),THREAD
  51. PrintPreviewQueue QUEUE
  52. PrintPreviewImage   STRING(80)
  53.                   END
  54. Status                 FILE,DRIVER('TOPSPEED'),PRE(STA),CREATE,THREAD
  55. Key_Status               KEY(STA:Status),NOCASE,OPT
  56. Record                   RECORD
  57. Status                      STRING(15)
  58.                          END
  59.                        END
  60. Status::Used LONG,THREAD
  61.  
  62. contacts               FILE,DRIVER('TOPSPEED'),PRE(CON),CREATE,THREAD
  63. ID_Key                   KEY(CON:ID),NOCASE,OPT
  64. Key_LastName             KEY(CON:LastName),DUP,NOCASE
  65. Key_Company              KEY(CON:Company),DUP,NOCASE
  66. Date_Lead_Received       KEY(-CON:DateLead),DUP,NOCASE,OPT
  67. Key_Car                  KEY(CON:TypeCar),DUP,NOCASE,OPT
  68. Remarks                     MEMO(256)
  69. Record                   RECORD
  70. FirstName                   STRING(20)
  71. ID                          STRING(4)
  72. LastName                    STRING(20)
  73. Company                     STRING(25)
  74. Address1                    STRING(25)
  75. Address2                    STRING(25)
  76. City                        STRING(25)
  77. State                       STRING(2)
  78. Zip                         STRING(5)
  79. Phone                       DECIMAL(10)
  80. Fax                         DECIMAL(10)
  81. JobTitle                    STRING(25)
  82. Interest                    STRING(45)
  83. TimeFrame                   STRING(15)
  84. CurrentSoftware             STRING(25)
  85. TypeCar                     STRING(20)
  86. DateLead                    STRING(8)
  87. Status                      STRING(15)
  88.                          END
  89.                        END
  90. contacts::Used LONG,THREAD
  91.  
  92.   CODE
  93.   Main
  94.  
  95. CheckOpen         PROCEDURE(File,OverrideCreate,OverrideOpenMode)
  96.  
  97.   CODE
  98.   IF OMITTED(3)
  99.     OPEN(File,42h)                                !Attempt to open the file
  100.   ELSE
  101.     OPEN(File,OverrideOpenMode)
  102.   END
  103.   CASE ERRORCODE()                                ! and check for errors
  104.   OF NoError                                      !Return if no error
  105.   OROF IsOpenErr                                  ! or if already open.
  106.     DO ProcedureReturn
  107.   OF NoFileErr                                    !If file was not found
  108.     IF OMITTED(2)
  109.     ELSIF OverrideCreate = TRUE
  110.       DO CreateFile
  111.     ELSE
  112.       IF StandardWarning(Warn:CreateError,NAME(File)).
  113.     END
  114.   OF InvalidFileErr                               !Invalid Record Declaration
  115.     IF StandardWarning(Warn:InvalidFile,NAME(File)).
  116.   OF BadKeyErr                                    !Key Files must be rebuilt
  117.     IF StandardWarning(Warn:InvalidKey,NAME(File))
  118.       BUILD(File)                              !Rebuild the key files
  119.     END
  120.     IF ERRORCODE()
  121.       IF StandardWarning(Warn:RebuildError,NAME(File)).
  122.     ELSE
  123.       IF OMITTED(3)
  124.         OPEN(File,42h)                            !Attempt to open the file
  125.       ELSE
  126.         OPEN(File,OverrideOpenMode)
  127.       END
  128.     END
  129.   END                                             !End of Case Structure
  130.   IF ERRORCODE()
  131.     IF StandardWarning(Warn:DiskError,NAME(File)) THEN HALT(0,'Disk Error').
  132.   END
  133.   DO ProcedureReturn
  134. ProcedureReturn ROUTINE
  135.   RETURN
  136. CreateFile ROUTINE
  137.   CREATE(File)                                    !Create the file
  138.   IF ERRORCODE()
  139.     IF ERRORCODE() = 90
  140.       IF StandardWarning(Warn:CreateError,NAME(File)).
  141.     ELSE
  142.       IF StandardWarning(Warn:CreateError,NAME(File)).
  143.     END
  144.   END
  145.   IF OMITTED(3)
  146.     OPEN(File,42h)                                !Attempt to open the file
  147.   ELSE
  148.     OPEN(File,OverrideOpenMode)
  149.   END
  150.   IF ~ERRORCODE()                                 !  And return if it opened
  151.     DO ProcedureReturn
  152.   ELSE
  153.     IF StandardWarning(Warn:CreateOpenError,NAME(File)).
  154.   END
  155.  
  156. ReportPreview        PROCEDURE
  157. LeftPageNumber       SHORT,AUTO
  158. PreviewWindow        WINDOW('Print Preview'),AT(,,316,218),CENTER,SYSTEM,GRAY
  159.                        BOX,AT(5,5,150,178),COLOR(00H)
  160.                        IMAGE(),AT(5,5,150,178),USE(?Image1)
  161.                        STRING(''),AT(95,185,55,10),USE(?Image1Page),RIGHT
  162.                        BOX,AT(160,5,150,178),COLOR(00H)
  163.                        IMAGE(),AT(160,5,150,178),USE(?Image2)
  164.                        STRING(''),AT(250,185,50,10),USE(?Image2Page),RIGHT
  165.                        BUTTON('&Previous Page'),AT(5,200,55,14),USE(?PreviewPreviousPage)
  166.                        BUTTON('&Next Page'),AT(65,200,55,14),USE(?PreviewNextPage)
  167.                        BUTTON('&Print'),AT(185,200,55,14),USE(?PreviewPrint)
  168.                        BUTTON('&Close'),AT(245,200,55,14),USE(?PreviewClose)
  169.                      END
  170.  
  171.    CODE
  172.    OPEN(PreviewWindow)
  173.    LeftPageNumber = 1
  174.    DO LoadPages
  175.    ACCEPT
  176.      CASE FIELD()
  177.      OF ?PreviewClose
  178.        IF Event() = Event:Accepted
  179.          GlobalResponse = RequestCancelled
  180.          POST(Event:CloseWindow)
  181.        END
  182.      OF ?PreviewPrint
  183.        IF Event() = Event:Accepted
  184.          GlobalResponse = RequestCompleted
  185.          POST(Event:CloseWindow)
  186.        END
  187.      OF ?PreviewPreviousPage
  188.        IF Event() = Event:Accepted
  189.          LeftPageNumber -= 2
  190.          DO LoadPages
  191.        END
  192.      OF ?PreviewNextPage
  193.        IF Event() = Event:Accepted
  194.          LeftPageNumber += 2
  195.          DO LoadPages
  196.        END
  197.      END
  198.    END
  199.    RETURN
  200.  
  201. LoadPages ROUTINE
  202.    IF LeftPageNumber = 1
  203.      ?PreviewPreviousPage{Prop:Disable}=True
  204.    ELSE
  205.      ?PreviewPreviousPage{Prop:Disable}=False
  206.    END
  207.    GET(PrintPreviewQueue,LeftPageNumber)
  208.    ?Image1{Prop:Text} = PrintPreviewImage
  209.    ?Image1Page{Prop:Text} = 'Page ' & LeftPageNumber
  210.    IF LeftPageNumber = RECORDS(PrintPreviewQueue)
  211.      ?PreviewNextPage{Prop:Disable}=True
  212.      ?Image2Page{Prop:Text} = ''
  213.      ?Image2{Prop:Hide} = True
  214.    ELSIF LeftPageNumber = RECORDS(PrintPreviewQueue) - 1
  215.      ?PreviewNextPage{Prop:Disable}=True
  216.      GET(PrintPreviewQueue,LeftPageNumber+1)
  217.      ?Image2{Prop:Text} = PrintPreviewImage
  218.      ?Image2Page{Prop:Text} = 'Page ' & LeftPageNumber+1
  219.      ?Image2{Prop:Hide} = False
  220.    ELSE
  221.      ?PreviewNextPage{Prop:Disable}=False
  222.      GET(PrintPreviewQueue,LeftPageNumber+1)
  223.      ?Image2{Prop:Text} = PrintPreviewImage
  224.      ?Image2Page{Prop:Text} = 'Page ' & LeftPageNumber+1
  225.      ?Image2{Prop:Hide} = False
  226.    END
  227.  
  228.  
  229. StandardWarning      FUNCTION(WarningID,WarningText1,WarningText2,WarningText3,WarningText4)
  230. ErrorText            STRING(150),AUTO
  231. ReturnValue          LONG
  232.   CODE
  233.   IF ERRORCODE() <> 90
  234.     ErrorText = CLIP(ERROR()) & ' (' & ERRORCODE() & ')'
  235.   ELSE
  236.     ErrorText = CLIP(FILEERROR()) & ' (' & CLIP(FILEERRORCODE()) & ')'
  237.   END
  238.   CASE WarningID
  239.   OF Warn:InvalidFile
  240.     IF MESSAGE('Error: (' & CLIP(ErrorText) & ') accessing ' |
  241.     & CLIP(WarningText1) & '.  Press OK to end this application.'|
  242.     ,'Invalid File',ICON:Exclamation,Button:OK,BUTTON:OK,0).
  243.     HALT(0,'Invalid File!')
  244.   OF Warn:InvalidKey     
  245.     IF MESSAGE(CLIP(WarningText1) & ' key file is invalid.  Do you '|
  246.     &'want to rebuild the key?','Invalid Key',Icon:Question,|
  247.     Button:Yes+Button:No,Button:Yes,0)=Button:No
  248.       HALT(0,'Invalid Key!')
  249.     ELSE
  250.       RETURN(Button:Yes)
  251.     END
  252.   OF Warn:RebuildError   
  253.     IF MESSAGE('Error: (' & CLIP(ErrorText) & ') repairing key for ' |
  254.     & CLIP(WarningText1) & '.  Press OK to end this application.',|
  255.     'Key Rebuild Error',ICON:Exclamation,Button:OK,BUTTON:OK,0).
  256.     HALT(0,'Error Rebuilding Key!')
  257.   OF Warn:CreateError    
  258.     IF MESSAGE('Error: (' & CLIP(ErrorText) & ') creating ' |
  259.     & CLIP(WarningText1) & '.  Press OK to end this application.',|
  260.     'File Creation Error',ICON:Exclamation,Button:OK,BUTTON:OK,0).
  261.     HALT(0,'File Creation Error!')
  262.   OF Warn:CreateOpenError
  263.     IF MESSAGE('Error: (' & CLIP(ErrorText) & ') opening created ' |
  264.     & 'file:' & CLIP(WarningText1) & '.  Press OK to end this application.',|
  265.     'File Creation Error',ICON:Exclamation,Button:OK,BUTTON:OK,0).
  266.     HALT(0,'File Creation Error!')
  267.   OF Warn:ProcedureToDo  
  268.     RETURN(MESSAGE('The Procedure ' & CLIP(WarningText1) & 'has not '|
  269.     &'been defined.','Procedure not defined',ICON:Exclamation,|
  270.     Button:OK,BUTTON:OK,0))
  271.   OF Warn:BadKeyedRec
  272.     RETURN(MESSAGE('Unable to read keyed record.  Error: ' |
  273.     & CLIP(ErrorText) & '.  Insert Aborted',ICON:Exclamation,|
  274.     Button:OK,Button:OK,0))
  275.   OF Warn:OutOfRangeHigh
  276.     RETURN(MESSAGE('The value of ' & CLIP(WarningText1) & ' must'|
  277.     &' be lower than ' & CLIP(WarningText2) & '.','Range Error',|
  278.     ICON:Exclamation,Button:OK,Button:OK,0))
  279.   OF Warn:OutOfRangeLow  
  280.     RETURN(MESSAGE('The value of ' & CLIP(WarningText1) & ' must be'|
  281.     &' higher than ' & CLIP(WarningText2) & '.','Range Error',|
  282.     ICON:Exclamation,Button:OK,Button:OK,0))
  283.   OF Warn:OutOfRange     
  284.     RETURN(MESSAGE('The value of ' & CLIP(WarningText1) & ' must be '|
  285.     &'between ' & CLIP(WarningText2) & ' and ' & CLIP(WarningText3) |
  286.     & '.','Range Error',ICON:Exclamation,Button:OK,Button:OK,0))
  287.   OF Warn:NotInFile
  288.     RETURN(MESSAGE('The value for ' & CLIP(WarningText1) & ' must be '|
  289.     &'found in the ' & CLIP(WarningText2) & ' file.','Field Contents '|
  290.     &'Error',ICON:Exclamation,Button:OK,Button:OK,0))
  291.   OF Warn:RestrictUpdate 
  292.     RETURN(MESSAGE('This record is referenced from the file '|
  293.     & CLIP(WarningText1) & '.  Linking field(s) have been restricted'|
  294.     & ' from change and have been reset to original values.',|
  295.     'Referential Integrity Update Error',ICON:Exclamation,|
  296.     Button:OK,Button:OK,0))
  297.   OF Warn:RestrictDelete 
  298.     RETURN(MESSAGE('This record is referenced from the file '|
  299.     & CLIP(WarningText1) & '.  This record cannot be deleted while'|
  300.     & ' these references exist.','Referential Integrity Delete Error'|
  301.     ,ICON:Exclamation,Button:OK,Button:OK,0))
  302.   OF Warn:InsertError
  303.     RETURN(MESSAGE('An error was experienced during the update of'|
  304.     & ' record.  Error: ' & CLIP(ErrorText) & '.'|
  305.     ,'Record Insert Error'|
  306.     ,ICON:Exclamation,Button:OK,Button:OK,0))
  307.   OF Warn:RIUpdateError
  308.     RETURN(MESSAGE('An error (' & CLIP(ErrorText) & ') was experienced'|
  309.     &' when attempting to update a record from the file.  Probable Cause: ' |
  310.     & CLIP(WarningText1) & '.','Update Operation Error',Icon:Exclamation,|
  311.     Button:OK,Button:OK,0))
  312.   OF Warn:UpdateError
  313.     RETURN(MESSAGE('An error was experienced changing this record.  '|
  314.     &'Do you want to try to save again?','Record Update Error',|
  315.     Icon:Exclamation,Button:Yes+Button:No+Button:Cancel,Button:Cancel,0))
  316.   OF Warn:RIDeleteError
  317.     RETURN(MESSAGE('An error (' & CLIP(ErrorText) & ') was experienced'|
  318.     &' when attempting to delete a record from the file ' |
  319.     & CLIP(WarningText1) & '.','Delete Operation Error',Icon:Exclamation,|
  320.     Button:OK,Button:OK,0))
  321.   OF Warn:DeleteError    
  322.     RETURN(MESSAGE('An error was experienced deleting this record.  '|
  323.     &'Do you want to try to save again?','Record Update Error',|
  324.     Icon:Exclamation,Button:Yes+Button:No+Button:Cancel,Button:Cancel,0))
  325.   OF Warn:InsertDisabled 
  326.     RETURN(MESSAGE('This procedure was called to insert a record, '|
  327.     & 'however inserts are not allowed for this procedure.  Press OK '|
  328.     & 'to return to the calling procedure','Invalid Request',|
  329.     Icon:Exclamation,Button:OK,Button:OK,0))
  330.   OF Warn:UpdateDisabled
  331.     RETURN(MESSAGE('This procedure was called to change a record, '|
  332.     & 'however changes are not allowed for this procedure.  Press OK '|
  333.     & 'to return to the calling procedure','Invalid Request',|
  334.     ICON:Exclamation,Button:OK,Button:OK,0))
  335.   OF Warn:DeleteDisabled 
  336.     RETURN(MESSAGE('This procedure was called to delete a record, '|
  337.     & 'however deletions are not allowed for this procedure.  Press OK '|
  338.     & 'to return to the calling procedure','Invalid Request',|
  339.     ICON:Exclamation,Button:OK,Button:OK,0))
  340.   OF Warn:NoCreate       
  341.     IF MESSAGE('The File ' & CLIP(WarningText1) & 'was not found, '|
  342.     &'and creation of the file is not allowed.  Press OK to end '|
  343.     &'this application.','File Creation Not Allowed',ICON:Exclamation,|
  344.     Button:OK,BUTTON:OK,0)
  345.       HALT(0,'File Creation Error!')
  346.     END
  347.   OF Warn:ConfirmCancel  
  348.     RETURN(MESSAGE('Do you want to save the changes to this record?'|
  349.     ,'Update Cancelled',ICON:Question,Button:Yes+Button:No+Button:Cancel,|
  350.     Button:No,0))
  351.   OF Warn:DuplicateKey
  352.     RETURN(MESSAGE('Adding this record creates a duplicate entry '|
  353.     &'for the key:' & CLIP(WarningText1),'Duplicate Key Error',|
  354.     ICON:Exclamation,Button:OK,Button:OK,0))
  355.   OF Warn:AutoIncError
  356.     RETURN(MESSAGE('Attempts to automatically number this record have '|
  357.     &'failed.  Error: ' & CLIP(ErrorText) & '.',|
  358.     'Auto Increment Error',Icon:Exclamation,Button:Cancel+Button:Retry,|
  359.     Button:Cancel,0))
  360.   OF Warn:FileLoadError
  361.     RETURN(MESSAGE(CLIP(WarningText1) & ' File Load Error.  '|
  362.     &'Error: ' & CLIP(ErrorText) & '.','File Load Error',ICON:Exclamation,|
  363.     Button:OK,Button:OK,0))
  364.   OF Warn:ConfirmCancelLoad
  365.     RETURN(MESSAGE('Are you certain you want to stop loading ' |
  366.     & CLIP(WarningText1) & '?','Cancel Request',|
  367.     ICON:Question,Button:OK+Button:Cancel,Button:Cancel,0))
  368.   OF Warn:FileZeroLength
  369.     RETURN(MESSAGE(CLIP(WarningText1) & ' File Load Error.  '|
  370.     &'The file you''ve requested contains no text.','File Load Error',|
  371.     ICON:Exclamation,Button:OK,Button:OK,0))
  372.   OF Warn:EndOfASCIIQueue
  373.     IF WarningText1 = 'Down'
  374.       RETURN(MESSAGE('The end of the viewed file was encountered.  '|
  375.       & 'Do you want to start again from the beginning?',|
  376.       'End of File Error',ICON:Question,Button:Yes+Button:No,Button:Yes,0))
  377.     ELSE
  378.       RETURN(MESSAGE('The beginning of the viewed file was encountered.  '|
  379.       & 'Do you want to start again from the end of the file?',|
  380.       'Beginning of File Error',ICON:Question,Button:Yes+Button:No,|
  381.       Button:Yes,0))
  382.     END
  383.   OF Warn:DiskError
  384.     RETURN(MESSAGE('File (' & CLIP(WarningText1) & ') could not be '|
  385.     & 'opened.  Error: ' & CLIP(ErrorText) & '.','File Access Error'|
  386.     ,Icon:Exclamation,Button:OK,Button:OK,0))
  387.   OF Warn:ProcessActionError
  388.     IF WarningText1 = 'Put'
  389.       RETURN(MESSAGE('An error was experienced when making changes'|
  390.       & ' to the ' & CLIP(WarningText2) & ' file.  Error: '|
  391.       & CLIP(ErrorText),'Process PUT Error',Icon:Exclamation|
  392.       ,Button:OK,Button:OK,0))
  393.     ELSE
  394.       RETURN(MESSAGE('An error was experienced when deleting a record'|
  395.       & ' from the ' & CLIP(WarningText2) & ' file.  Error: '|
  396.       & CLIP(ErrorText),'Process DELETE Error',Icon:Exclamation|
  397.       ,Button:OK,Button:OK,0))
  398.     END
  399.   END
  400.  
  401.  
  402. !--------------------------------------------------
  403. RIUpdate:Status      FUNCTION(Passed:Buffer)
  404. Process:Buffer       LIKE(STA:Record),PRE(RP),OVER(Passed:Buffer)
  405. Current:Buffer       LIKE(STA:Record),PRE(RC)
  406. Current:Position     STRING(512)
  407.   CODE
  408.   Current:Position = POSITION(STA:Key_Status)
  409.   Current:Buffer = STA:Record
  410.   LOGOUT(2,Status)
  411.   REGET(STA:Key_Status,Current:Position)
  412.   IF ERRORCODE()
  413.     IF StandardWarning(Warn:RIUpdateError,'Record Changed/Deleted by Another Station')
  414.       ROLLBACK()
  415.       DO RICloseFiles
  416.       RETURN(1)
  417.     END
  418.   END
  419.   IF STA:Record <> Passed:Buffer
  420.     IF StandardWarning(Warn:RIUpdateError,'Record Changed by Another Station')
  421.       ROLLBACK()
  422.       DO RICloseFiles
  423.       RETURN(1)
  424.     END
  425.   END
  426.   STA:Record = Current:Buffer
  427.   PUT(Status)
  428.   IF ERRORCODE()
  429.     IF StandardWarning(Warn:RIUpdateError,'Status')
  430.       ROLLBACK
  431.       DO RICloseFiles
  432.       RETURN(1)
  433.     END
  434.   ELSE
  435.     COMMIT
  436.     DO RICloseFiles
  437.     RETURN(0)
  438.   END
  439. !----------------------------------------------------------------------
  440. RICloseFiles ROUTINE
  441.   EXIT
  442.  
  443. !--------------------------------------------------
  444. RIDelete:Status      FUNCTION
  445. Current:Position     STRING(512)
  446.   CODE
  447.   Current:Position = POSITION(STA:Key_Status)
  448.   LOGOUT(2,Status)
  449.   REGET(STA:Key_Status,Current:Position)
  450.   DELETE(Status)
  451.   IF ERRORCODE()
  452.     IF StandardWarning(Warn:RIDeleteError,'Status')
  453.       ROLLBACK
  454.       DO RICloseFiles
  455.       RETURN(1)
  456.     END
  457.   ELSE
  458.     COMMIT
  459.     DO RICloseFiles
  460.     RETURN(0)
  461.   END
  462. !----------------------------------------------------------------------
  463. RICloseFiles ROUTINE
  464.   EXIT
  465.  
  466. !--------------------------------------------------
  467. RIUpdate:contacts    FUNCTION(Passed:Buffer)
  468. Process:Buffer       LIKE(CON:Record),PRE(RP),OVER(Passed:Buffer)
  469. Current:Buffer       LIKE(CON:Record),PRE(RC)
  470. Current:Position     STRING(512)
  471. Current:CON:Remarks  LIKE(CON:Remarks)
  472.   CODE
  473.   Current:Position = POSITION(CON:ID_Key)
  474.   Current:Buffer = CON:Record
  475.   Current:CON:Remarks = CON:Remarks
  476.   LOGOUT(2,contacts)
  477.   REGET(CON:ID_Key,Current:Position)
  478.   IF ERRORCODE()
  479.     IF StandardWarning(Warn:RIUpdateError,'Record Changed/Deleted by Another Station')
  480.       ROLLBACK()
  481.       DO RICloseFiles
  482.       RETURN(1)
  483.     END
  484.   END
  485.   IF CON:Record <> Passed:Buffer
  486.     IF StandardWarning(Warn:RIUpdateError,'Record Changed by Another Station')
  487.       ROLLBACK()
  488.       DO RICloseFiles
  489.       RETURN(1)
  490.     END
  491.   END
  492.   CON:Record = Current:Buffer
  493.   CON:Remarks = Current:CON:Remarks
  494.   PUT(contacts)
  495.   IF ERRORCODE()
  496.     IF StandardWarning(Warn:RIUpdateError,'contacts')
  497.       ROLLBACK
  498.       DO RICloseFiles
  499.       RETURN(1)
  500.     END
  501.   ELSE
  502.     COMMIT
  503.     DO RICloseFiles
  504.     RETURN(0)
  505.   END
  506. !----------------------------------------------------------------------
  507. RICloseFiles ROUTINE
  508.   EXIT
  509.  
  510. !--------------------------------------------------
  511. RIDelete:contacts    FUNCTION
  512. Current:Position     STRING(512)
  513.   CODE
  514.   Current:Position = POSITION(CON:ID_Key)
  515.   LOGOUT(2,contacts)
  516.   REGET(CON:ID_Key,Current:Position)
  517.   DELETE(contacts)
  518.   IF ERRORCODE()
  519.     IF StandardWarning(Warn:RIDeleteError,'contacts')
  520.       ROLLBACK
  521.       DO RICloseFiles
  522.       RETURN(1)
  523.     END
  524.   ELSE
  525.     COMMIT
  526.     DO RICloseFiles
  527.     RETURN(0)
  528.   END
  529. !----------------------------------------------------------------------
  530. RICloseFiles ROUTINE
  531.   EXIT
  532.  
  533.